package geometry;

import org.lwjgl.opengl.GL11;
import objReader.Vertex3;

public class glPlane 
{
	public Vertex3 p1;
	public Vertex3 p2;
	
	public glPlane(float x1, float y1, float z1, 
			       float x2, float y2, float z2)
	{
		p1 = new Vertex3(x1, y1, z1);
		p2 = new Vertex3(x2, y2, z2);
	}
	
	public void drawPlane()
	{
		GL11.glPushMatrix();

		GL11.glDisable(GL11.GL_TEXTURE_2D);
		GL11.glEnable(GL11.GL_COLOR_MATERIAL);
		
		GL11.glColor3f(0.4f, 0.4f, 0.4f);
		GL11.glBegin(GL11.GL_QUADS);
			//GL11.glColor3f(1.0f, 0, 0);
			GL11.glVertex3f(p1.x, p1.y, p1.z); /* Bottom Left */
			
			//GL11.glColor3f(0, 1.0f, 0);
			GL11.glVertex3f(p2.x, p1.y, p1.z); /* Bottom right */
			
			//GL11.glColor3f(0, 0, 1.0f);
			GL11.glVertex3f(p2.x, p2.y, p2.z); /* Top right */
			
			//GL11.glColor3f(1.0f, 0.5f, 0.8f);
			GL11.glVertex3f(p1.x, p2.y, p2.z);
		GL11.glEnd();
		
		GL11.glPopMatrix();
	}
}


